<template>
	<view class="coll_home">
		<view class="collection">
			<view v-for="(item,idnex) in CollectionList" key="index" class="coll_box">
				<div @click="defails(item)">
					<img :src="item.pic" alt="" />
					<p class="coll_shopname">{{item.prodName}}</p>
					<p class="coll_price">￥{{item.price}}</p>
				</div>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		request
	} from '../../../utils/request.js'
	export default {
		data() {
			return {
				CollectionList: [],
				current: 1,
				size: 10,
			}
		},
		methods: {
			getNoticeList() {
				request({
					url: "/p/user/collection/prods",
					method: "GET",
				}).then(res => {
					this.CollectionList = res.records
				})
			},
			defails(item) {
				console.log(item);
				uni.navigateTo({
					url: "/pages/component/details/details?item=" + encodeURIComponent(JSON.stringify(item.prodId))
				})
			},
		},
		onLoad() {
			this.getNoticeList()
		}
	}
</script>

<style>
	@import url("collection.css");
</style>
